package com.q.dao.impl;

import com.q.bean.User;
import com.q.dao.UserDao;
import com.q.util.JDBCUtil;
import org.apache.commons.dbutils.QueryRunner;

import org.apache.commons.dbutils.handlers.BeanListHandler;

import java.sql.SQLException;
import java.util.List;

public class UserDaoImpl implements UserDao {
    @Override
    public List<User> ShowUser(Integer page, Integer limit) throws Exception{

             List<User> list =new QueryRunner(JDBCUtil.getDataSource()).query("select * from user limit ?,?",
                    new BeanListHandler<User>(User.class),page,limit);
             return list;
    }
}
